_ = require 'underscore'

{query,remove,save} = require './otc_sypz_date_serv'

# 查询
module.exports.query = (req, res, cbf) ->
  params =
    # 当前页号
    pageNum : req.params?.pageNum or req.query?.pageNum or 1
    # 每页记录数
    pageSize : req.params?.pageSize or req.query?.pageSize or 10
    
    # 查询条件
    query :
    
      # 雇员姓名
      name : req.params?.name or req.query?.name or ''
    
      # 性别
      gendle : req.params?.gendle or req.query?.gendle or ''
    
  return query params, cbf

# 删除
module.exports.remove = (req, res, cbf) ->
  params =
    _id : req.params?._id or req.query?._id or ''

  return remove params, cbf

# 保存或修改
module.exports.Save = (req, res, cbf) ->
  params ={}
  params =
    obj:req.body?.cpjz
  console.log params
  # 保存净值
  return save params?.obj, cbf